<?php


namespace app\model;


use think\Model;

class Site extends Model
{
    public static function info($id)
    {
        return Site::where('id',$id)->field('id,site_name,site_url,company_id,language_id,keyword,description,wx_qrcode,qq,address,phone,email,fax,hlogo,flogo,public_img,content,record')->find();
    }
    public static function saveSite($data)
    {
        if(isset($data['content']) && $data['content']){
            $data['content'] = htmlspecialchars_decode($data['content']);
        }
        if(isset($data['id']) && $data['id']){
            $res = Site::update($data);
        }else{
            $res = Site::insert($data);
        }
        return $res;
    }
    public static function delSite($id)
    {
        return Site::where('id','in',$id)->delete();
    }
}